﻿Public Class Reputation
    Property ID As Integer
    Property Key As String
    Property Name As String
    Property Value As Integer

    Public ReadOnly Property ReputationStatus As Enums.ReputationStatus
        Get
            Dim oRepStatus As Enums.ReputationStatus
            Select Case Value
                Case Is < -6000
                    oRepStatus = Enums.ReputationStatus.Hated
                Case -6000 To -3001
                    oRepStatus = Enums.ReputationStatus.Hostile
                Case -3000 To -1
                    oRepStatus = Enums.ReputationStatus.Unfriendly
                Case 0 To 3000
                    oRepStatus = Enums.ReputationStatus.Neutral
                Case 3001 To 9000
                    oRepStatus = Enums.ReputationStatus.Friendly
                Case 9001 To 21000
                    oRepStatus = Enums.ReputationStatus.Honored
                Case 21001 To 42000
                    oRepStatus = Enums.ReputationStatus.Revered
                Case Is > 42000
                    oRepStatus = Enums.ReputationStatus.Exalted
                Case Else
                    oRepStatus = Enums.ReputationStatus.Neutral
            End Select
            Return oRepStatus
        End Get
    End Property

    Public ReadOnly Property RelativeValue() As Integer
        Get
            Dim res As Integer = 0
            Select Case ReputationStatus
                Case Enums.ReputationStatus.Hated
                    res = _Value + 42000
                Case Enums.ReputationStatus.Hostile
                    res = _Value + 6000
                Case Enums.ReputationStatus.Unfriendly
                    res = _Value + 3000
                Case Enums.ReputationStatus.Neutral
                    res = _Value
                Case Enums.ReputationStatus.Friendly
                    res = _Value - 3000
                Case Enums.ReputationStatus.Honored
                    res = _Value - 9000
                Case Enums.ReputationStatus.Revered
                    res = _Value - 21000
                Case Enums.ReputationStatus.Exalted
                    res = _Value - 42000
            End Select
            Return res
        End Get
    End Property

    Public ReadOnly Property RelativeMax() As Integer
        Get
            Dim res As Integer = 0
            Select Case ReputationStatus
                Case Enums.ReputationStatus.Hated
                    res = 36000
                Case Enums.ReputationStatus.Hostile
                    res = 3000
                Case Enums.ReputationStatus.Unfriendly
                    res = 3000
                Case Enums.ReputationStatus.Neutral
                    res = 3000
                Case Enums.ReputationStatus.Friendly
                    res = 6000
                Case Enums.ReputationStatus.Honored
                    res = 12000
                Case Enums.ReputationStatus.Revered
                    res = 21000
                Case Enums.ReputationStatus.Exalted
                    res = 1000
            End Select
            Return res
        End Get
    End Property

    Public ReadOnly Property RelativeRatio() As Double
        Get
            Return (Me.RelativeValue / Me.RelativeMax)
        End Get
    End Property
End Class


